//
//  WmcCloudClassifyAlbumVM.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/5/14.
//

import UIKit

class WmcCloudClassifyAlbumVM: WmcBaseVM {

    /// 团队相册
    var teamAblum: WmcMediaTeamAlbumModel?
    
    /// 界面显示的列表数据
    private(set) var dataSource: [WmcMediaAlbumModel] = []
    
    func fetchList(completion: @escaping ([WmcMediaAlbumModel]) -> Void, failure: @escaping (Error?) -> Void) {
        WmcMediaAlbumAPI.fetchAlbumList().subscribe(onNext: { [weak self] list in
            guard let weakSelf = self else { return }
            weakSelf.dataSource = list
            completion(list)
        }, onError: { error in
            failure(error)
        }).disposed(by: rx.disposeBag)
    }
}
